import request from '@/config/axios'

export interface AppVO {
  id: number
  appCategoryId: number
  appName: string
  appIconUrl: string
  appIconColor: string
  appIconBgUrl: string
  appIconName: string
  appUrl: string
  appRemark: string
  appStatus: byte
}

// 查询官网应用列表
export const getAppPage = async (params) => {
  return await request.get({ url: `/official-website/app/page`, params })
}

// 查询官网应用详情
export const getApp = async (id: number) => {
  return await request.get({ url: `/official-website/app/get?id=` + id })
}

// 新增官网应用
export const createApp = async (data: AppVO) => {
  return await request.post({ url: `/official-website/app/create`, data })
}

// 修改官网应用
export const updateApp = async (data: AppVO) => {
  return await request.put({ url: `/official-website/app/update`, data })
}

// 删除官网应用
export const deleteApp = async (id: number) => {
  return await request.delete({ url: `/official-website/app/delete?id=` + id })
}

// 导出官网应用 Excel
export const exportApp = async (params) => {
  return await request.download({ url: `/official-website/app/export-excel`, params })
}
